
//***********************************************
//
//      Filename: Guessing.java
//
//        Author: wwb
//        Mails: 1274860621@qq.com
//        Create: 2018-04-07 14:15:26
// Last Modified: 2018-04-07 14:15:26
//***********************************************
import java.util.*;
public class Guessing
{
public static void main(String[]args)
{
final int MAX = 10;
int answer, guess;

Scanner scan = new Scanner(System.in);
Random generator = new Random();

answer = generator.nextInt(MAX) + 1;

System.out.print("I'm thinking of a number between 1 and " + MAX + ".Guess what it is: ");
guess = scan.nextInt();

if (guess == answer)
System.out.println("You got it! Good guessing!");
else
{
System.out.println("That is not correct, sorry.");
System.out.println("The number was " + answer);
}
}
}
